package com.example.demo.constant;

import lombok.Getter;
import lombok.ToString;

/**
 *@Description 错误信息枚举
 *@Author Levi
 *@Date 2019/4/23-14:24
*/
@Getter
@ToString
public enum ResponseCode {

    /**
     * 成功
     */
    SUCCESS(200, "成功"),

    TOKEN_IS_NULL(1000,"token为空"),
    TOKEN_PARSE_FAILURE(1001,"token解析失败"),
    TOKEN_IS_INVALID(1002,"token无效"),

    OPERATOR_NOT_EXIST(4001, "操作员不存在"),
    OPERATOR_USERNAME_HAS_BEEN_DELETED(4001, "操作员已删除"),
    OPERATOR_USERNAME_HAS_MORE(4003, "用户名存在多个，请联系管理员"),
    OPERATOR_USERNAME_NOT_EXIST(4004, "用户名不存在"),
    OPERATOR_USERNAME_HAS_BEEN_EXIST(4005, "用户名已存在"),
    OPERATOR_PASSWORD_IS_WRONG(4006, "密码错误"),
    /**
     * 失败
     */
    FAIL(-1, "失败");





    /**
     * 返回码
     */
    private int code;

    /**
     * 返回信息
     */
    private String msg;

    ResponseCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
